import request from "@/api/request"

export function add(data){
    return request({
        method: "post",
        url: "/api/revexp/add",
        data: data,
        headers: "Content-Type:application/json",
    });
}

export function edit(data){
    return request({
        method: "put",
        url: "/api/revexp/edit",
        data: data,
        headers: "Content-Type:application/json",
    });
}

export function del(id){
    return request({
        method: "delete",
        url: "/api/revexp/" + id,
    });
}

export function getPageByDescribes(page,describes){
    return request({
        method: "get",
        url: "/api/revexp/page",
        params: {
            page: page,
            describes: describes,
        },
    });
}

export function getByCondition(dateRange,adderList,typeList){
    return request({
        method: "get",
        url: "/api/revexp/condition",
        params: {
            dateRange: dateRange,
            adderList: adderList,
            typeList: typeList,
        },
    });
}

export function getStatisticsByUsername(username){
    return request({
        method: "get",
        url: "/api/revexp/statistics",
        params: {
            username: username,
        },
    });
}

export function getByDate(dates,users){
    return request({
        method: "get",
        url: "/api/revexp/date",
        params: {
            dates: dates,
            users: users,
        },
    });
}